package com.saltedfish.tool.net;



import com.saltedfish.tool.model.LoginInfo;
import com.saltedfish.tool.model.ModelInfo;
import com.saltedfish.tool.model.UpdateVersion;

import cn.droidlover.xdroidmvp.bean.BaseModel;
import io.reactivex.Flowable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;

/**
 * Created by jack on 2019/4/31.
 */

public interface DyService {


    /**
     * 登录
     */
    @POST(HttpUrls.LOGIN_LOGIN)
    Flowable<BaseModel<LoginInfo>> login(@Body RequestBody body);

    @POST(HttpUrls.update_Token)
    Flowable<BaseModel<LoginInfo>> updateToken();



    /**
     * 文件上传
     * @return
     */
    @Multipart
    @POST(HttpUrls.UPLOAD_FILE)
    Flowable<BaseModel<ModelInfo>> uploadFile(@Part MultipartBody.Part file);


    @GET(HttpUrls.DOWNLOAD_FILE)
    Flowable downloadFile();



    @GET(HttpUrls.get_Latest_Version)
    Flowable<BaseModel<UpdateVersion>> getLatestVersion(@Query("device-type") String deviceType, @Query("version-name") String versionName);


}
